import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

import '../../config/Config.dart';

class ProductContentSecond extends StatefulWidget {
  final Map contentObj;
  ProductContentSecond({this.contentObj});

  @override
  State<StatefulWidget> createState() =>
      ProductContentSecondState(contentObj: this.contentObj);
}

class ProductContentSecondState extends State<ProductContentSecond> with AutomaticKeepAliveClientMixin {
  //  缓存
  @override
  bool get wantKeepAlive => true;

  Map contentObj;
  ProductContentSecondState({this.contentObj});

  @override
  Widget build(BuildContext context) {
    super.build(context);
    // this method overrides a method annotated as '@mustCallSuper' in AutomaticKeepAliveClientMixin,but does not invoke the overridden method
    return Container(
      height: double.infinity,
      child: InAppWebView(
        initialUrl: "${Config.domain}pcontent?id=${contentObj['_id']}"
      )
    );
  }
}
